cmake_minimum_required(VERSION 2.8)
project(nsis)

set(ROOT_DIR "${PROJECT_SOURCE_DIR}/..")
set(DEFAULT_DIST ${ROOT_DIR}/bin/Debug)
file(GLOB files ${DEFAULT_DIST}/*.exe)

set(CPACK_NSIS_MODIFY_PATH ON)

install(FILES ${files} DESTINATION bin)
#install(TARGETS ver DESTINATION bin)
#install(DIRECTORY ${PROJECT_SOURCE_DIR}/user DESTINATION .)

set(CPACK_PACKAGE_NAME single)
set(CPACK_PACKAGE_VENDOR "lwsf/sample")
set(CPACK_NSIS_CONTACT "admin@crscd.com.cn")

set(CPACK_PACKAGE_VERSION_MAJOR 0)
set(CPACK_PACKAGE_VERSION_MINOR 3)
set(CPACK_PACKAGE_VERSION_PATCH 2)

set(CPACK_PACKAGE_VERSION 0.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
message(STATUS ${ROOT_DIR} " VER: " ${CPACK_PACKAGE_VERSION})

set(CPACK_PACKAGE_DESCRIPTION_FILE ${ROOT_DIR}/WELCOME.txt)
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "A smart tool for self-documatation.")

SET(CPACK_RESOURCE_FILE_WELCOME ${ROOT_DIR}/WELCOME.txt)
SET(CPACK_RESOURCE_FILE_README  ${ROOT_DIR}/README.txt)
SET(CPACK_RESOURCE_FILE_LICENSE ${ROOT_DIR}/LICENSE.txt)
set(CPACK_PACKAGE_INSTALL_DIRECTORY "sample")

include(CPack)

